home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / DirectSound / EffectsBuffers / frmFlanger.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-08  |  8.7 KB  |  295 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmFlanger 
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Flanger Effects Update"
  6.    ClientHeight    =   4440
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   2775
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   4440
  14.    ScaleWidth      =   2775
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   1  'CenterOwner
  17.    Begin VB.OptionButton optTriangle 
  18.       Caption         =   "Triangle"
  19.       Height          =   255
  20.       Left            =   1680
  21.       TabIndex        =   2
  22.       Top             =   3540
  23.       Width           =   915
  24.    End
  25.    Begin VB.OptionButton optSin 
  26.       Caption         =   "Sine"
  27.       Height          =   255
  28.       Left            =   120
  29.       TabIndex        =   1
  30.       Top             =   3540
  31.       Width           =   915
  32.    End
  33.    Begin VB.CommandButton cmdOK 
  34.       Caption         =   "OK"
  35.       Height          =   315
  36.       Left            =   1800
  37.       TabIndex        =   0
  38.       Top             =   3960
  39.       Width           =   915
  40.    End
  41.    Begin MSComctlLib.Slider sldFeedback 
  42.       Height          =   195
  43.       Left            =   60
  44.       TabIndex        =   3
  45.       Top             =   300
  46.       Width           =   2655
  47.       _ExtentX        =   4683
  48.       _ExtentY        =   344
  49.       _Version        =   393216
  50.       LargeChange     =   10
  51.       Min             =   -99
  52.       Max             =   99
  53.       SelStart        =   1
  54.       TickFrequency   =   10
  55.       Value           =   1
  56.    End
  57.    Begin MSComctlLib.Slider sldDelay 
  58.       Height          =   195
  59.       Left            =   60
  60.       TabIndex        =   4
  61.       Top             =   840
  62.       Width           =   2655
  63.       _ExtentX        =   4683
  64.       _ExtentY        =   344
  65.       _Version        =   393216
  66.       LargeChange     =   2
  67.       Max             =   4
  68.    End
  69.    Begin MSComctlLib.Slider sldDepth 
  70.       Height          =   195
  71.       Left            =   60
  72.       TabIndex        =   5
  73.       Top             =   1380
  74.       Width           =   2655
  75.       _ExtentX        =   4683
  76.       _ExtentY        =   344
  77.       _Version        =   393216
  78.       Max             =   100
  79.       TickFrequency   =   10
  80.    End
  81.    Begin MSComctlLib.Slider sldFreq 
  82.       Height          =   195
  83.       Left            =   60
  84.       TabIndex        =   6
  85.       Top             =   1920
  86.       Width           =   2655
  87.       _ExtentX        =   4683
  88.       _ExtentY        =   344
  89.       _Version        =   393216
  90.       TickFrequency   =   2
  91.    End
  92.    Begin MSComctlLib.Slider sldPhase 
  93.       Height          =   195
  94.       Left            =   60
  95.       TabIndex        =   7
  96.       Top             =   2460
  97.       Width           =   2655
  98.       _ExtentX        =   4683
  99.       _ExtentY        =   344
  100.       _Version        =   393216
  101.       LargeChange     =   2
  102.       Max             =   4
  103.    End
  104.    Begin MSComctlLib.Slider sldWetDry 
  105.       Height          =   195
  106.       Left            =   60
  107.       TabIndex        =   8
  108.       Top             =   3000
  109.       Width           =   2655
  110.       _ExtentX        =   4683
  111.       _ExtentY        =   344
  112.       _Version        =   393216
  113.       LargeChange     =   10
  114.       SmallChange     =   5
  115.       Max             =   100
  116.       SelStart        =   1
  117.       TickFrequency   =   10
  118.       Value           =   1
  119.    End
  120.    Begin VB.Label lbl 
  121.       BackStyle       =   0  'Transparent
  122.       Caption         =   "Frequency"
  123.       Height          =   255
  124.       Index           =   4
  125.       Left            =   60
  126.       TabIndex        =   15
  127.       Top             =   1680
  128.       Width           =   1035
  129.    End
  130.    Begin VB.Label lbl 
  131.       BackStyle       =   0  'Transparent
  132.       Caption         =   "Depth"
  133.       Height          =   255
  134.       Index           =   3
  135.       Left            =   60
  136.       TabIndex        =   14
  137.       Top             =   1140
  138.       Width           =   1035
  139.    End
  140.    Begin VB.Label lbl 
  141.       BackStyle       =   0  'Transparent
  142.       Caption         =   "Delay"
  143.       Height          =   255
  144.       Index           =   0
  145.       Left            =   60
  146.       TabIndex        =   13
  147.       Top             =   600
  148.       Width           =   735
  149.    End
  150.    Begin VB.Label lbl 
  151.       BackStyle       =   0  'Transparent
  152.       Caption         =   "Feedback"
  153.       Height          =   255
  154.       Index           =   1
  155.       Left            =   60
  156.       TabIndex        =   12
  157.       Top             =   60
  158.       Width           =   735
  159.    End
  160.    Begin VB.Label lbl 
  161.       BackStyle       =   0  'Transparent
  162.       Caption         =   "Phase"
  163.       Height          =   255
  164.       Index           =   2
  165.       Left            =   60
  166.       TabIndex        =   11
  167.       Top             =   2220
  168.       Width           =   1035
  169.    End
  170.    Begin VB.Label lbl 
  171.       BackStyle       =   0  'Transparent
  172.       Caption         =   "Wave Form"
  173.       Height          =   255
  174.       Index           =   5
  175.       Left            =   60
  176.       TabIndex        =   10
  177.       Top             =   3300
  178.       Width           =   915
  179.    End
  180.    Begin VB.Label lbl 
  181.       BackStyle       =   0  'Transparent
  182.       Caption         =   "Wet Dry Mix"
  183.       Height          =   255
  184.       Index           =   6
  185.       Left            =   60
  186.       TabIndex        =   9
  187.       Top             =   2760
  188.       Width           =   1035
  189.    End
  190. Attribute VB_Name = "frmFlanger"
  191. Attribute VB_GlobalNameSpace = False
  192. Attribute VB_Creatable = False
  193. Attribute VB_PredeclaredId = True
  194. Attribute VB_Exposed = False
  195. Option Explicit
  196. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  197. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  198. '  File:       frmFlanger.frm
  199. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  200. Private oBuffer As DirectSoundSecondaryBuffer8
  201. Private mlIndex As Long
  202. Private oFX As DirectSoundFXFlanger8
  203. Private Sub SaveAllSettings()
  204.     Dim fxNew As DSFXFLANGER
  205.     'Ok, save these new settings
  206.     'Set the new information up
  207.     With fxNew
  208.         .fFeedback = CSng(sldFeedback.Value)
  209.         .fDelay = CSng(sldDelay.Value)
  210.         .fDepth = CSng(sldDepth.Value)
  211.         .fWetDryMix = CSng(sldWetDry.Value)
  212.         .fFrequency = CSng(sldFreq.Value)
  213.         .lPhase = sldPhase.Value
  214.         If optSin.Value Then
  215.             .lWaveform = DSFX_WAVE_SIN
  216.         ElseIf optTriangle.Value Then
  217.             .lWaveform = DSFX_WAVE_TRIANGLE
  218.         End If
  219.     End With
  220.     'Now update the effect
  221.     oFX.SetAllParameters fxNew
  222. End Sub
  223. Private Sub cmdOK_Click()
  224.     SaveAllSettings
  225.     Unload Me
  226. End Sub
  227. Private Sub Form_Load()
  228.     Dim fxCurrent As DSFXFLANGER
  229.     'Get the echo interface
  230.     Set oFX = oBuffer.GetObjectinPath(DSFX_STANDARD_FLANGER, mlIndex, IID_DirectSoundFXFlanger)
  231.     'Get the current settings from it
  232.     fxCurrent = oFX.GetAllParameters
  233.     'Now put them out there
  234.     With fxCurrent
  235.         sldFeedback.Value = CLng(.fFeedback)
  236.         sldDelay.Value = CLng(.fDelay)
  237.         sldDepth.Value = CLng(.fDepth)
  238.         sldWetDry.Value = CLng(.fWetDryMix)
  239.         sldFreq.Value = CLng(.fFrequency)
  240.         sldPhase.Value = .lPhase
  241.         If .lWaveform = DSFX_WAVE_SIN Then
  242.             optSin.Value = True
  243.         ElseIf .lWaveform = DSFX_WAVE_TRIANGLE Then
  244.             optTriangle.Value = True
  245.         End If
  246.     End With
  247. End Sub
  248. Public Sub SetBuffer(oBuf As DirectSoundSecondaryBuffer8, Index As Long)
  249.     'Store the buffer and index
  250.     Set oBuffer = oBuf
  251.     mlIndex = Index
  252. End Sub
  253. Private Sub optSin_Click()
  254.     SaveAllSettings
  255. End Sub
  256. Private Sub optTriangle_Click()
  257.     SaveAllSettings
  258. End Sub
  259. Private Sub sldDelay_Change()
  260.     SaveAllSettings
  261. End Sub
  262. Private Sub sldDelay_Scroll()
  263.     SaveAllSettings
  264. End Sub
  265. Private Sub sldDepth_Change()
  266.     SaveAllSettings
  267. End Sub
  268. Private Sub sldDepth_Scroll()
  269.     SaveAllSettings
  270. End Sub
  271. Private Sub sldFeedback_Change()
  272.     SaveAllSettings
  273. End Sub
  274. Private Sub sldFeedback_Scroll()
  275.     SaveAllSettings
  276. End Sub
  277. Private Sub sldFreq_Change()
  278.     SaveAllSettings
  279. End Sub
  280. Private Sub sldFreq_Scroll()
  281.     SaveAllSettings
  282. End Sub
  283. Private Sub sldPhase_Change()
  284.     SaveAllSettings
  285. End Sub
  286. Private Sub sldPhase_Scroll()
  287.     SaveAllSettings
  288. End Sub
  289. Private Sub sldWetDry_Change()
  290.     SaveAllSettings
  291. End Sub
  292. Private Sub sldWetDry_Scroll()
  293.     SaveAllSettings
  294. End Sub
  295.